package com.example.goods_admin.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;

import java.util.Date;

public class Book {


    @ExcelIgnore //设置导出时不导出这个字段
    private String bookId;

    @ExcelProperty(value="书名",index = 0)
    @ColumnWidth(15) // 设置宽度为16个字符
    private String bookName;
    @ExcelProperty(value="作者",index = 1)
    @ColumnWidth(15) // 设置宽度为16个字符
    private String author;
    @ExcelProperty(value="价格",index = 2)
    private double price;
    @ExcelProperty(value="图书编号",index = 3)
    @ColumnWidth(25) // 设置宽度为16个字符
    private String isbn;
    @ExcelProperty(value="出版社",index = 4)
    @ColumnWidth(15) // 设置宽度为16个字符
    private String publisher;
    @ExcelProperty(value="发行日期",index = 5)
    @ColumnWidth(20) // 设置宽度为16个字符
//    @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date releaseTime;

    @ExcelIgnore
    private String status;

    public Book() {
    }


    public static void main(String[] args) {
        Book book = new Book();

        //book 反射
        Class<? extends Book> aClass = book.getClass();
        System.out.println(aClass.getName());
    }

    public Book(String bookId, String bookName, String author, double price, String isbn, String publisher, Date releaseTime, String status) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.author = author;
        this.price = price;
        this.isbn = isbn;
        this.publisher = publisher;
        this.releaseTime = releaseTime;
        this.status = status;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public Date getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(Date releaseTime) {
        this.releaseTime = releaseTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
